<template>
  <div class="HIS">
    <div class="aop sm-aop" v-if="!Token">
      <h1>{{ title }}</h1>
      <button
        class="btn btn-danger"
        style="float: right; height: 60%; margin: 8px"
        @click="outSys()"
      >
        <i class="fa fa-power-off auto"></i>
      </button>
      <el-button
        size="mini"
        style="
          float: right;
          height: 60%;
          margin: 8px;
          font-size: 16px;
          color: #000;
        "
        @click="to"
        plain
        icon="el-icon-s-home"
      ></el-button>
      <span style="float: right; height: 60%; margin: 8px; color: white"
        >当前用户：{{ LoginInfor.UserName }}</span
      >
      <span style="float: right; height: 60%; margin: 8px; color: white"
        >所属机构：{{ LoginInfor.HospitalName }}</span
      >
      <ul v-if="false">
        <li v-for="(item, index) in datalist" :key="index">
          <span @click="getdata(item)">
            <i class="glyphicon glyphicon-yen"></i>
            {{ item.title }}
          </span>
        </li>
      </ul>
    </div>

    <!-- <div class="bottom" v-if="!Token">
      <div class="pucMenu menu" v-if="isMentShow">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo menu"
          @open="handleOpen"
          @close="handleClose"
          background-color="#293841"
          text-color="#fff"
          :unique-opened="true"
          active-text-color="#ffd04b"
        >
          <el-submenu
            :index="index + ''"
            v-for="(item, index) in arraydata"
            :key="index"
          >
            <template slot="title">
              <i :class="item.icon"></i>
              <span>{{ item.title }}</span>
            </template>
            <el-menu-item-group>
              <el-tree
                style=" margin-left: 4rem"
                :data="childrenList"
                @node-click="handleNodeClick"
                accordion
                node-key="id"
                :default-expanded-keys="idArr"
                :props="defaultProps"
              >
              </el-tree>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </div>
      <div class="context">
        <router-view></router-view>
      </div>
    </div> -->
    <div class="bottom">
      <div class="pucMenu menu" v-if="!Token">
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo menu"
          @open="handleOpen"
          @close="handleClose"
          background-color="#293841"
          text-color="#fff"
          :unique-opened="true"
          active-text-color="#ffd04b"
        >
          <el-submenu
            :index="index + ''"
            v-for="(item, index) in data"
            :key="index"
          >
            <template slot="title">
              <i :class="item.icon"></i>
              <span>{{ item.title }}</span>
            </template>
            <el-menu-item-group>
              <el-tree
                style="margin-left: 4rem"
                :data="data[index].children"
                @node-click="handleNodeClick"
                accordion
                node-key="id"
                :default-expanded-keys="idArr"
                :props="defaultProps"
              >
              </el-tree>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </div>
      <div class="context" :style="Token ? 'top:0;left:0;' : ''">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>
<script>
import data from "@/assets/menu.json";

export default {
  data() {
    return {
      Token: this.$route.query.Token,
      data: data[0].children,
      isMentShow: false,
      isNotShowMuth: [],
      datalist: [],
      title: "",
      isArraydata: [],
      arraydata: [],
      flag: 1,
      childrenList: [],
      defaultProps: {
        children: "children",
        label: "title",
      },
      name: "",
      showbottom: false,
      index: "",
      idArr: [],
      value: "",
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
      ],
      ZiFei: "",
      optionZiFei: [
        {
          value: "选项1",
          label: "黄金糕",
        },
      ],
      activeName: "first",
      liname: 1,
      desc: "",
      restaurants: [],
      state: "",
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      message: "成功获取病人信息！！",
      XYin: true,
      textShow: false,
      dynamicTags: ["Diagnosis1", "Diagnosis2"],
      inputVisible: false,
      inputValue: "",
      optionsoptions: [],
      value1: "",
      value2: "",
      lishow: false,
      LoginInfor: {
        SectionName: "",
        UserName: "",
        HospitalName: "",
      },
      muenh_list: [], //总菜单
    };
  },
  methods: {
    //登出操作
    outSys() {
      var data = "";
      this.$post("UserManage/Logout", data)
        .then((res) => {
          // console.log("登录信息返回结果");
          // console.log(res);
          if (res.code == 0) {
            // console.log(res.data);
            localStorage.setItem("LoginInfor", "");
            localStorage.setItem("user_id", "");
            localStorage.setItem("user_name", "");
            localStorage.setItem("dept_id", "");
            localStorage.setItem("Token", "");
            this.$setToken(null);
            this.$router.replace({
              path: "/login",
            });
          } else {
            this.$message({ message: res.msg, type: "error" });
          }
        })
        .catch((err) => {
          console.log(err);
          this.$message({
            message: "登录异常",
            type: "error",
          });
        });
    },
    outSys2His() {
      this.$post("CloudHIS/Logout", data)
        .then((res) => {
          // console.log("登录信息返回结果");
          // console.log(res);
          if (res.code == 0) {
            // console.log(res.data);
            localStorage.setItem("LoginInfor", "");
            localStorage.setItem("user_id", "");
            localStorage.setItem("user_name", "");
            localStorage.setItem("dept_id", "");
            this.$setToken(null);
            this.$router.replace({
              path: "/login",
            });
          } else {
            this.$message({ message: res.msg, type: "error" });
          }
        })
        .catch((err) => {
          console.log(err);
          this.$message({
            message: "登录异常",
            type: "error",
          });
        });
    },
    getdata(info) {
      console.log("点击头跳转");
      // console.log(info)
      this.arraydata = info.children;
      this.name = info.name;
      for (var i = 0; i < info.children.length; i++) {
        if (info.children[0].url) {
          this.$router.push({
            path: `/${info.name}/${info.children[0].url}`,
            query: info.children[0],
          });
          return;
        } else {
          for (var j = 0; j < info.children[0].children.length; j++) {
            if (info.children[0].children[0].url) {
              this.idArr.push(info.children[0].children[0].id);
              this.$router.push({
                path: `/${info.name}/${info.children[0].children[0].url}`,
                query: info.children[0].children[0],
              });
              // console.log(info.children[0].children[0].id);
              return;
            } else {
              for (
                var j = 0;
                j < info.children[0].children[0].children.length;
                j++
              ) {
                if (info.children[0].children[0].children[0].url) {
                  this.idArr.push(info.children[0].children[0].children[0].id);
                  this.$router.push({
                    path: `/${info.name}/${info.children[0].children[0].children[0].url}`,
                    query: info.children[0].children[0].children[0],
                  });
                  // console.log(info.children[0].children[0].children[0].id);
                  return;
                } else {
                  this.$router.push({ path: "/" });
                }
              }
            }
          }
        }
      }
      // console.log(info);
    },
    handleNodeClick(data) {
      this.isUrl = data.url;
      // console.log("点击跳转路径")
      // console.log(data)

      if (data.url) {
        // if (data.url == 'CWZT') {
        //   let routeData = this.$router.resolve({ path: '/text', query: data });
        //   window.open(routeData.href, '_blank');
        //   return
        // }
        let _this = this;
        let Hname = _this.name;
        this.$router.push({
          path: `/SystemManagement/${data.url}`,
        });
      }
    },
    handleClick(tab, event) {
      // console.log(tab);
      // console.log(event);
    },
    submit(index) {
      this.index = index;
      var arr = window.document.getElementsByTagName("input");
      for (var i = 0; i < arr.length; i++) {
        var t = arr[i];
        t.index = i;
        t.onkeydown = function (event) {
          if (event.keyCode == 13) {
            var next = this.index + 1;
            arr[next].focus();
          }
        };
      }
      // console.log(arr);
    },
    PCWMedicine() {
      this.liname = 1;
    },
    JYXmu() {
      this.liname = 2;
    },
    JCXmu() {
      this.liname = 3;
    },
    KSJcha() {
      this.liname = 4;
    },
    QTFYXmu() {
      this.liname = 5;
    },
    querySearch(queryString, cb) {
      var restaurants = this.restaurants;
      var results = queryString
        ? restaurants.filter(this.createFilter(queryString))
        : restaurants;
      cb(results);
    },
    createFilter(queryString) {
      return (restaurant) => {
        return (
          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
          0
        );
      };
    },
    loadAll() {
      return [
        { value: "三全鲜食（北新泾店）", address: "长宁区新渔路144号" },
        {
          value: "Hot honey 首尔炸鸡（仙霞路）",
          address: "上海市长宁区淞虹路661号",
        },
      ];
    },
    handleSelect(item) {
      // console.log(item);
    },
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex === 1) {
        return "warning-row";
      } else if (rowIndex === 3) {
        return "success-row";
      }
      return "";
    },
    Submission() {
      let j = {
        date: "2019-05-03",
        name: "王虎",
        address: "上海市金沙江路 1518 弄",
      };
      this.tableData.push(j);
      // console.log("备注");
    },
    divYin() {
      this.XYin = false;
    },
    divXIan() {
      this.XYin = true;
    },
    TextDisplay() {
      this.textShow = true;
    },
    handleClose(tag) {
      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
    },
    showInput() {
      this.inputVisible = true;
      this.$nextTick((_) => {
        this.$refs.saveTagInput.$refs.input.focus();
      });
    },
    handleInputConfirm() {
      let inputValue = this.inputValue;
      if (inputValue) {
        this.dynamicTags.push(inputValue);
      }
      this.inputVisible = false;
      this.inputValue = "";
      // console.log(this.dynamicTags);
    },
    //获取菜单
    getMenu() {
      //读卡
      // console.log("菜单");
      var data = {
        model: "11.综合维护-权限信息",
        code: "11055",
        input: {},
      };
      // console.log(data);
      let info = JSON.parse(localStorage.getItem("LoginInfor")).UserId;
      this.$get("/roles/" + info + "/permissions")
        .then((res) => {
          // console.log("获取菜单信息返回结果")
          // console.log(res);
          if (res.code == 0 && res.data != null) {
            this.setMenuData(res.data);
          } else {
            this.$message({ message: res.msg, type: "error" });
            // console.log("菜单返回结果")
            // console.log(res.data);
          }
        })
        .catch((err) => {
          console.log(err);
          this.$message({
            message: "未获取菜单相关信息",
            type: "error",
          });
        });
    },
    getMenuList(UserId) {
      var params = {
        UserId: UserId,
      };
      //GET /api/UserManage/GetPermissionList
      this.$get("UserManage/GetPermissionList", params)
        .then((res) => {
          // console.log("用户菜单列表查询结果");
          // console.log(res);
          if (res.code == 0) {
            var menuList = [];
            menuList.push(res.data);
            this.setMenuData(menuList);

            if (this.datalist.length > 0) {
              this.getdata(this.datalist[0]);
            }
            this.restaurants = this.loadAll();
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    //菜单加工
    setMenuData(oldMenuData) {
      // console.log('菜单');
      // console.log(oldMenuData);
      var menuList = [];
      oldMenuData.forEach((m) => {
        var menuObj = {
          //一层菜单
          id: m.id,
          title: m.title,
          name: "SystemManagement", // m.name,
          children: [],
        };
        if (m.childs != null && m.childs.length > 0) {
          m.childs.forEach((m) => {
            var menuChildrenObj = {
              //二层菜单
              id: m.id,
              title: m.title,
              name: m.title,
              url: m.url,
              children: [],
            };
            if (m.childs != null && m.childs.length > 0) {
              m.childs.forEach((m) => {
                var menuChildrenObjItem = {
                  //三层菜单
                  id: m.id,
                  title: m.title,
                  name: m.title,
                  url: m.url,
                  children: [],
                };

                if (m.childs != null && m.childs.length > 0) {
                  m.childs.forEach((m) => {
                    var menuChildrenObjItem4 = {
                      //四层菜单
                      id: m.id,
                      title: m.title,
                      name: m.title,
                      url: m.url,
                    };
                    menuChildrenObjItem.children.push(menuChildrenObjItem4);
                  });
                }
                menuChildrenObj.children.push(menuChildrenObjItem);
              });
            }
            menuObj.children.push(menuChildrenObj);
          });
        }
        menuList.push(menuObj);
      });
      // console.info("菜单");
      // console.info(menuList);
      this.datalist = menuList;
    },
    //  cnpm install         babel-plugin-syntax-jsx
    //  cnpm install babel-plugin-transform-vue-jsx
    //  cnpm install  babel-helper-vue-jsx-merge-props
    //  cnpm install babel-preset-env

    remove(node, data) {
      // console.log("菜单选中")
      // console.log(node);
      // console.log(data)
    },
    handleOpen(key, keyPath) {
      // console.log(key);
      this.childrenList = this.arraydata[key].children;
      // console.log(this.childrenList);
      // let arrdat = this.isArraydata[key]
      // this.childrenList = this.isArraydata[key]
      // this.isNotShowMuth.forEach(i => {
      //   console.log('菜单点击事件');
      //   console.log(i);
      //   if (arrdat.id == i.id) {
      //     this.isArraydata = []
      //     this.isArraydata.push(arrdat)
      //   } else {
      //     return
      //   }
      // })
      // if (this.isArraydata[key].children == undefined) {
      //   this.childrenList = [this.isArraydata[key]]
      // }
    },
    handleClose(key, keyPath) {
      // console.log(key, keyPath);
    },
    to() {
      this.$router.push("/SystemManagement/Home_home");
    },
    timeOut() {
      if (!this.$route.query.Token) {
        if (this.flag == 1) {
          setTimeout(() => {
            var that = this;
            this.$get("/HeartBeat/Index")
              .then((res) => {
                // console.log(res);
                if (res.code == 0) {
                  that.flag = 1;
                  that.timeOut();
                }
              })
              .catch(() => {
                alert("登录状态失效！请重新登录");
                this.$router.push("/login");
              });
            return;
          }, 60000);
        } else {
          this.flag = 2;
          return;
        }
        this.flag = 2;
      }
    },
  },
  created() {
    // var url = "http://192.168.0.210:8002/v1"// 测试地址
    // var url = "http://114.115.206.101:8801/v1"//   线上地址
    // var url = "http://192.168.200.172:8094/v1"//   线上测试地址

    if (this.$route.query.Token) {
      localStorage.setItem("Token", this.$route.query.Token);
    }
    if (
      localStorage.getItem("No_token") ||
      !!this.$route.query.Token ||
      !!this.$route.query
    ) {
    } else {
      this.$router.push("/login");
      this.$notify.error({
        title: "提示",
        message: "无效token！",
      });
    }
    this.$setBaseUrl(url);
    // if (this.$getToken() == null) {
    // if (localStorage.getItem('Token') == null || localStorage.getItem('Token') == undefined) {
    //   this.$router.replace({
    //     path: '/login',
    //   })
    // }
    // 定时刷新
    // this.timeOut()
  },
  mounted() {
    this.getMenu();
    var loginInfor = localStorage.getItem("LoginInfor");
    this.LoginInfor = JSON.parse(loginInfor);
    // console.log("个人登录信息");
    // console.log(this.LoginInfor);
    if (this.LoginInfor == null) {
      this.LoginInfor = {
        SectionName: "",
        UserName: "",
      };
    }
    //68940680
    // var UserID = localStorage.getItem("user_id", "");
    // console.log("用户ID")
    // console.log(UserID)
    // this.getMenuList(UserID);
    this.datalist = data; //动态菜单
    if (this.datalist.length > 0) {
      this.getdata(this.datalist[0]);
    }
    // console.log(data);
    //邮寄领票
    //
    this.restaurants = this.loadAll();
  },
  watch: {
    $route(to) {
    return
      // console.log('to');
      // console.log(to);
      if (to.path == "/SystemManagement/Home_home") {
        this.title = "主页";
      }
      if (this.title == "主页" || this.title == undefined) {
        this.title = to.query.label;
      }
      var str = to.query.label;
      let info = JSON.parse(localStorage.getItem("LoginInfor")).UserId;
      this.$get("/roles/" + info + "/permissions").then((res) => {
        // console.log(res);
        this.muenh_list = res.data;
        // console.log('菜单总数');
        // console.log(res.data);
      });
      let array = this.muenh_list;
      // console.log('菜单总数');
      let arr = [];
      // console.log(array);
      for (var i in array) {
        arr.push(array[i]);
        // console.log(array[i]);
      }
      this.isNotShowMuth = arr;
      // console.log("arr");
      // console.log(arr);
      if (to.path == "/") {
        this.showbottom = false;
      } else {
        this.showbottom = true;
        array.forEach((v) => {
          // console.log(v);
          if (v.title == str) {
            this.arraydata = v.children;
          }
        });
      }
      if (to.path == "/SystemManagement/Home_home") {
        this.isMentShow = false;
      } else {
        this.isMentShow = true;
        // this.childrenList = this.arraydata[key].children
        let key = to.query.label;
        // console.log('key');
        // console.log(key);
        // console.log('这是key' + key);
        this.arraydata.forEach((i) => {
          // console.log("i");
          // console.log(i);
          if (i.title == this.arraydata[0].title) {
            if (i.children) {
              this.isArraydata = i.children;
            } else {
              this.isArraydata = i;
            }
            // console.log("路由");
            // console.log(i.children);
          }
        });
      }
      // console.log(11111);
      // console.log(this.$route);
      if (this.$route.query.Token) {
        localStorage.setItem("Token", this.$route.query.Token);
      }
    },
  },
};
</script>
<style lang="scss">
.z_red {
  color: white;
}

.menu {
  .custom-tree-node {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    padding-right: 8px;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
      "Microsoft YaHei", "微软雅黑", Arial, sans-serif, Medium;
  }

  .custom-tree-nodefont {
    font-size: 16px;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
      "Microsoft YaHei", "微软雅黑", Arial, sans-serif, Medium;
    /*width: 14rem!important;*/
    padding-left: 0.5rem !important;
    padding-right: 1rem !important;
    margin: 12px !important;
  }

  .el-tree-node.is-current > .el-tree-node__content > .custom-tree-nodefont {
    background-color: #0f74cc !important;
  }

  .el-tree-node.is-current > .el-tree-node__content {
    background-color: #0f74cc !important;
  }

  .el-tree-node__content:hover {
    background-color: #202c31 !important;
  }

  .el-tree-node__content {
    height: 38px !important;
  }
  .el-menu-item-group__title {
    display: none;
  }
}

.Outpatient {
  position: fixed;
  top: 46px;
  left: 0;
  right: 0;
}

.Outpatient .topLine {
  padding: 6px 15px 3px 15px;
  // background: url(./images/line0.png) repeat-x;
  background-size: contain;
  min-width: 1180px;
}

.Outpatient .topLine > div {
  height: 28px;
  margin-bottom: 3px;
}

.Outpatient .topLine .form-control {
  height: 28px;
  padding: 0 5px;
  float: left;
}

.Outpatient .topLine .btn {
  height: 28px;
  padding: 0 10px;
  float: left;
}

.Outpatient .topLine span {
  float: left;
  display: block;
  line-height: 26px;
  background: #f6f6f6;
  border: 1px solid #ccc;
  margin-right: -3px;
  position: relative;
  padding-left: 5px;
  z-index: 2;
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}

.Outpatient .topLine b {
  float: left;
  display: block;
  line-height: 28px;
}

.Outpatient .topLine label {
  float: left;
  line-height: 28px;
}

.Outpatient .topLine .line1 p {
  float: left;
}

.Outpatient .topLine .line1 p:nth-child(2) {
  margin-left: 18px;
}

.Outpatient .topLine .line1 p:nth-child(2) input {
  margin-right: -1px;
}

.Outpatient .topLine .line1 p:nth-child(2) select {
  border-radius: 0;
  position: relative;
  margin-left: -2px;
  margin-right: -2px;
}

.Outpatient .topLine .line1 .btn {
  margin-left: 5px;
}

.Outpatient .topLine .line2 input {
  width: 1071px;
}

.Outpatient .topLine .line3 p {
  margin-right: 15px;
  float: left;
}

.Outpatient .topLine .line3 label {
  padding-right: 8px;
  background: #fff;
  height: 26px;
  padding-left: 8px;
  position: relative;
  top: 1px;
}

.Outpatient .topLine .line3 label input {
  position: relative;
  top: 1px;
  margin-right: 3px;
}

.Outpatient .oMain ul {
  height: 30px;
  line-height: 29px;
  margin: 3px 0 0 15px;
  position: relative;
  top: 1px;
  z-index: 2;
}

.Outpatient .oMain ul li {
  background: #eee;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  color: #666;
  float: left;
  padding: 0 15px;
  border-top: 1px solid #ddd;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
}

.Outpatient .oMain ul li.high {
  background: #fff;
  color: #333;
}

.Outpatient .oMain .clearfix {
  border: 1px solid #ddd;
  margin: 0 15px;
  position: fixed;
  left: 0;
  right: 20px;
  top: 182px;
  bottom: 40px;
}

.Outpatient .oneLt {
  width: 200px;
  float: left;
}

.Outpatient .oneLt dl {
  margin: 0;
}

.liclass {
  background: #e2f1fd !important;
}

.Outpatient .oneLt dt {
  background: #f6f6f6;
  height: 28px;
  line-height: 28px;
  margin: 5px;
  cursor: pointer;
  text-align: center;
}

.Outpatient .oneLt dd {
  padding: 2px 10px;
  max-height: 310px;
  overflow-y: auto;
  display: none;
  margin-right: 5px;
}

.ulclass {
  display: block !important;
}

@media screen and (min-height: 880px) {
  .Outpatient .oneLt dd {
    max-height: 480px;
  }
}

.Outpatient .oneLt dd p {
  line-height: 18px;
  margin-bottom: 5px;
}

.Outpatient .oneLt dd p:last-child {
  margin-bottom: 0;
}

.Outpatient .twoLt {
  width: 210px;
  float: left;
  margin-left: 5px;
}

.Outpatient .twoLt .form-control {
  height: 25px;
  padding: 0 5px;
}

.Outpatient .twoLt .btn {
  height: 26px;
  padding: 0 12px;
  position: relative;
  top: -2px;
}

.Outpatient .threeRt {
  position: absolute;
  right: 10px;
  left: 415px;
  top: 0;
  height: 100%;
}

.Outpatient .threeRt .Tb {
  position: absolute;
  right: 0;
  left: 0;
  border: 1px solid #ddd;
  bottom: 40px;
  top: 32px;
}

.Outpatient .threeRt .Tb + p {
  position: absolute;
  bottom: 10px;
  font-weight: bold;
}

.Outpatient .threeRt .Tb + p span {
  margin-right: 25px;
}

.Outpatient .threeRt .Tb + p b {
  font-weight: bold;
}

.Outpatient .threeRt table {
  border: none;
}

.Outpatient .threeRt table label {
  margin: 0;
  padding: 0 3px;
  cursor: pointer;
}

.Outpatient .threeRt table th,
.Outpatient .threeRt table td {
  padding: 4px 5px;
}

.Outpatient .threeRt table td:first-child {
  border-left: none;
}

.Outpatient .threeRt table td:last-child {
  border-right: none;
}

.Outpatient .threeRt .glyphicon-paperclip {
  color: blue;
  display: inline-block;
  padding: 3px 8px;
  cursor: pointer;
  width: 30px;
}

.Outpatient .cek {
  height: 32px;
  line-height: 32px;
  text-align: right;
}

.Outpatient .cek label {
  margin-left: 10px;
}

.Outpatient .cek input {
  position: relative;
  top: 1px;
  margin-right: 3px;
}

.Outpatient .rdo {
  position: absolute;
  height: 32px;
  line-height: 32px;
  top: 0;
  z-index: 2;
}

.Outpatient .rdo span {
  font-weight: bold;
}

.Outpatient .rdo input {
  position: relative;
  top: 1px;
  margin-right: 3px;
}

.Outpatient .rdo label {
  margin-left: 10px;
  cursor: pointer;
}

.Outpatient .twoLt .ultwoli {
  display: none;
}

.Outpatient .twoLt .form-group {
  padding-top: 32px;
}

.Outpatient .twoLt .form-group b {
  display: block;
  font-weight: bold;
}

.Outpatient .twoLt .form-group p {
  margin-bottom: 2px;
}

.Outpatient .twoLt .form-group span {
  display: inline-block;
  min-width: 42px;
}

.Outpatient .footLine {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 40px;
  background: #eee;
  width: 100%;
  padding: 4px 15px;
}

.Outpatient .btn-add {
  float: right;
  margin: 10px 13px 0 0;
}

/*弹框：动态信息*/
.dynamicBg .panel-default {
  width: 1000px;
  margin: 30px auto;
  background: #fff;
  border-radius: 5px;
  position: relative;
}

.dynamicBg .panel-default:after {
  content: "";
  width: 1px;
  height: 445px;
  background: #f5f5f5;
  position: absolute;
  left: 50%;
  top: 40px;
}

.dynamicBg .twoList > div {
  width: 50%;
  float: left;
  padding: 0 15px;
}

.dynamicBg .Tb {
  border: 1px solid #ddd;
  height: 406px;
  overflow-y: auto;
}

.dynamicBg .table {
  border: none;
}

.dynamicBg .table td:first-child {
  border-left: none;
}

.dynamicBg .table td:last-child {
  border-right: none;
}

.dynamicBg .table td,
.dynamicBg .table th {
  padding: 4px 5px;
}

.dynamicBg .p1 {
  margin: 5px 0;
}

.dynamicBg .p1 b {
  color: red;
  padding: 0 3px;
  font-weight: bold;
}

.dynamicBg .p1 .btn {
  padding: 0 12px;
  height: 28px;
  margin-left: 5px;
}

.dynamicBg .p1 input[type="text"] {
  padding: 0 5px;
  height: 28px;
  width: 135px;
  float: left;
}

.dynamicBg .p1 span {
  margin-right: 20px;
  float: left;
  line-height: 28px;
}

.dynamicBg .footBtn {
  height: 32px;
  margin: 8px 0 12px 0;
}

.dynamicBg .footBtn .btn:first-child {
  margin-right: 20px;
}

.dynamicBg .noData {
  text-align: center;
  color: red;
  padding: 13px 0;
  border: none;
}

/*侧边栏*/
.SideLine {
  position: fixed;
  top: 46px;
  bottom: 40px;
  right: 8px;
  background: #e6e6e6;
  width: 25px;
  text-align: center;
  cursor: pointer;
  border-bottom: 1px solid #ddd;
}

.divclassTFalse {
  display: none;
}

.SideLine p {
  position: absolute;
  top: 50%;
  margin-top: -55px;
  color: #666;
}

.Sidebar {
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 99;
}

.Sidebar > div {
  width: 300px;
  background: #fff;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  padding: 0 10px;
}

.Sidebar .line1 {
  height: 32px;
  margin: 5px 0;
}

.Sidebar .Tb {
  border: 1px solid #ddd;
  height: 258px;
  overflow-y: auto;
}

.Sidebar .Tb table {
  border: none;
  margin: 0;
}

.Sidebar .Tb table td {
  padding: 4px 5px;
}

.Sidebar .Tb table tr:first-child td {
  border-top: none;
}

.Sidebar .Tb table td:first-child {
  border-left: none;
}

.Sidebar .Tb table td:last-child {
  border-right: none;
}

.Sidebar select {
  height: 28px;
  width: 160px;
}

.Sidebar .line2 {
  position: absolute;
  top: 300px;
  bottom: 0;
  right: 10px;
  width: 280px;
  overflow-y: auto;
  background: #e9f1ff;
  padding: 10px 5px 0 5px;
}

.Sidebar .line2 dl {
  clear: both;
}

.Sidebar .line2 dt {
  float: left;
  color: blue;
}

.Sidebar .line2 dd {
  float: right;
  width: 228px;
  margin-bottom: 5px;
}

.Sidebar .line3 {
  position: absolute;
  bottom: 0;
  right: 10px;
  width: 280px;
  height: 90px;
  display: none;
}

.Sidebar .line3 input[type="checkbox"] {
  position: relative;
  top: 2px;
  margin-right: 3px;
  margin-left: 50px;
}

.Sidebar .line3 input[type="text"] {
  width: 35px;
  height: 20px;
  background: #eee;
  border: 1px solid #bbb;
}

.Sidebar .line3 p:nth-child(2) {
  margin: 7px 0 3px 0;
}

.Sidebar .arrow_1 {
  right: 300px;
  z-index: 3;
  position: fixed;
  top: 50%;
  height: 110px;
  width: 32px;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  color: #888;
  line-height: 18px;
  background: rgba(243, 243, 243, 0.8);
  margin-top: -55px;
  cursor: pointer;
  padding: 10px;
}

/*弹框 检验报告样式*/
.yanReport .panel-default {
  width: 1000px;
  margin: 30px auto;
  background: #fff;
  position: relative;
  border-radius: 5px;
}

.Report {
  height: 510px;
}

.Report .form-group {
  margin: 0;
  padding: 5px 0;
}

.Report .form-group p:first-child {
  margin-left: 15px;
}

.Report .oneBox p .btn {
  margin-right: 5px !important;
}

.importBox .Tb .table {
  border: none;
}

.importBox .table th,
.importBox .table td {
  padding: 4px 5px;
}

.importBox .Tb .table td:first-child {
  border-left: none;
}

.importBox .Tb .table td:last-child {
  border-right: none;
}

.yanReport .Report .speed {
  clear: both;
  padding: 5px 15px 0 15px;
}

.yanReport .Report .speed div {
  margin: -22px 0 6px 75px;
  height: 16px;
  background: #f3f3f3;
  border-radius: 15px;
  overflow: hidden;
}

.yanReport .Report .speed div span {
  display: inline-block;
  background: #67e467;
  height: 16px;
}

.yanReport .Report .blue {
  color: blue;
}

.yanReport .Report .red {
  color: red;
}

.yanReport .Report .pucType2 .form-control {
  padding: 0 5px;
  width: 120px;
}

.yanReport .Report .pucType2 p {
  margin-left: 13px;
}

.yanReport .Report .oneBox p {
  margin-right: 0 !important;
}

.yanReport .Report .oneBox p .btn {
  margin-right: 5px !important;
}

.yanReport .importBox .Tb {
  position: absolute;
  top: 130px;
  width: 400px;
  bottom: 10px;
  left: 15px;
  border: 1px solid #ddd;
  overflow-y: auto;
}

.yanReport .importBox .Main {
  position: absolute;
  top: 130px;
  bottom: 10px;
  left: 425px;
  right: 15px;
  border: 1px solid #ddd;
  overflow-y: auto;
  background: #f8f8f8;
  padding: 0 15px;
}

.yanReport .importBox .Main .line1 {
  padding: 10px 0 20px 0;
  text-align: right;
  width: 100%;
}

.yanReport .importBox .Main .line1 .btn {
  margin-left: 10px;
}

.yanReport .importBox .Main div {
  clear: both;
}

.yanReport .importBox .Main div p:nth-child(2) {
  margin-left: 30px;
}

.yanReport .importBox .Main .line2 p {
  float: left;
}

.yanReport .importBox .Main .line3 {
  padding-top: 8px;
}

.yanReport .importBox .Main .line3 p:first-child {
  margin-bottom: 8px;
}

.yanReport .importBox .Main textarea {
  resize: none;
  height: 100px;
}

.yanReport .importBox .Main .area {
  padding-top: 8px;
  padding-left: 74px;
  margin-bottom: -5px;
}

.yanReport .importBox .Main .area label {
  vertical-align: top;
  margin-left: -74px;
  padding-top: 5px;
}

/*弹框 模板*/
.Template .panel-default {
  width: 1000px;
  margin: 30px auto;
  background: #fff;
  position: relative;
  border-radius: 5px;
}

.Template .peel label {
  background: none !important;
  border: none !important;
  cursor: pointer;
  margin-right: 10px !important;
}

.Template .peel label input {
  position: relative;
  top: 1px;
  margin-right: 3px;
}

.Template .Report .rt .btn {
  float: right;
  margin: 0 0 0 10px;
}

.Template .importBox .Tb {
  position: absolute;
  top: 95px;
  width: 240px;
  bottom: 10px;
  left: 15px;
  border: 1px solid #ddd;
  overflow: auto;
}

.Template .importBox .Tb2 input[type="checkbox"] {
  position: relative;
  top: 1px;
  margin-right: 3px;
}

.Template .importBox .Main {
  position: absolute;
  top: 95px;
  bottom: 10px;
  left: 270px;
  right: 15px;
  overflow-y: auto;
}

.Template .importBox .h6 {
  font-size: 15px;
  margin: 0;
  height: 30px;
  color: #0092ff;
  line-height: 26px;
}

.bottom {
  width: 100%;
  display: flex;
  justify-content: space-around;

  .pucMenu {
    position: fixed;
    top: 46px;
    left: 0;
    bottom: 0;
    padding-top: 8px;
    z-index: 2;
    background: #363942;
    width: 200px;
    overflow-y: auto;
    overflow-x: hidden;

    .el-tree {
      background: transparent;
      color: #ccc;
    }
  }

  .pucMenu::-webkit-scrollbar,
  .pucMenu::-moz-scrollbar {
    display: none;
  }

  .pucMenu dl {
    color: #fff;
    margin: 0;
    cursor: pointer;
    margin-bottom: 1px;
  }

  .pucMenu dl dt {
    line-height: 36px;
    padding-left: 5px;
    color: #ddd;
    background: #494f5a;
  }

  .pucMenu dl dt b {
    font-size: 18px;
    float: right;
    line-height: 36px;
    padding-right: 10px;
  }

  .pucMenu dl .high {
    background: #ecf4ff !important;
    color: #333;
  }

  .lefthidden {
    display: none;
  }

  .pucMenu dl .force {
    background: #494f5a !important;
    color: #ddd !important;
  }

  .pucMenu dl i {
    font-size: 16px;
    margin: 0 11px 0 1px;
    display: inline-block;
    width: 13px;
  }

  .pucMenu dl dd:hover {
    background: #3a5876;
  }

  .pucMenu dl dd {
    line-height: 32px;
    padding-left: 15px;
    color: #ddd;
    display: none;
  }

  .pucMenu dl:first-child dd {
    display: block;
  }

  .IfGuahao {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: none;
    padding-left: 170px;
  }

  .arrow {
    left: 153px;
    z-index: 3;
    position: fixed;
    top: 50%;
    height: 34px;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    background: #d0ebff;
    margin-top: -20px;
    cursor: pointer;
    font-family: cursive;
    font-weight: bold;
    padding: 8px 5px;
    box-shadow: 1px 1px 5px #abb4bb;
  }

  .arrow2 {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    background: #5b6779;
    color: #fff;
  }

  .context {
    position: fixed;
    right: 0;
    top: 46px;
    bottom: 0;
    left: 200px;
    z-index: 99;
  }
}
.auto {
  text-align: center;
  align-items: center;
}
</style>
